Relational Algebra


Q21.

Given two union compatible relations R_1(A, B) and R_2 (C, D), what is the result of the operation R_1 \Join_{ A = C \wedge B = D} R_2?
GateOverflow

Q22.

Given the relations employee (name, salary, dept-no), and department (dept-no, dept-name,address), Which of the following queries cannot be expressed using the basic relational algebra operations \left(\sigma, \pi,\times ,\Join, \cup, \cap,-\right)?
GateOverflow

Q23.

Let R and S be two relations with the following schema R (\underline{P},\underline{Q},R1,R2,R3) S (\underline{P},\underline{Q},S1,S2) Where {P, Q} is the key for both schemas. Which of the following queries are equivalent? I. \Pi _{P}(R\Join S) II. \Pi _{p}(R)\Join \Pi _{P}(S) III. \Pi _{P}(\Pi _{P,Q}(R)\cap \Pi _{P,Q}(S)) IV. \Pi _{P}(\Pi _{P,Q}(R)-(\Pi _{P,Q}(R)-\Pi _{P,Q}(S)))
GateOverflow

Q24.

Which of the following query transformations (i.e., replacing the l.h.s. expression by the r.h.s expression) is incorrect? R_1 and R_2 are relations, C_1 and C_2 are selection conditions and A_1 and A_1 are attributes of R_1.
GateOverflow

Q25.

Suppose the adjacency relation of vertices in a graph is represented in a table Adj(X,Y). Which of the following queries cannot be expressed by a relational algebra expression of constant length ?
GateOverflow

Q26.

Consider the following relational schema:Student(school-id,sch-roll-no,sname,saddress) School(school-id,sch-name,sch-address,sch-phone) Enrolment(school-id,sch-roll-no,erollno,examname) ExamResult(erollno,examname,marks) Consider the following tuple relational calculus query. \begin{array}{l} \{t \mid \exists E \in \text { Enrolment } t=E \text { .school-id } \\ \wedge \mid\{x \mid x \in \text { Enrolment } \wedge x . \text { school-id }=t \wedge(\exists B \in \text { ExamResult } B . \text { erollno }=x . \text { erollno } \wedge B \\ \text { examname }=x . \text { examname } \wedge B . \text { marks }>35)\}|\div|\{x \mid x \in \text { Enrolment } \wedge x . \text { school-id }=t\} \mid \\ * 100>35\} \end{array}If a student needs to score more than 35 marks to pass an exam, what does the query return?
GateOverflow

Q27.

Consider a selection of the form \sigma_{A\leq 100} (r), where r is a relation with 1000 tuples. Assume that the attribute values for A among the tuples are uniformly distributed in the interval [0, 500]. Which one of the following options is the best estimate of the number of tuples returned by the given selection query ?
GateOverflow

Q28.

Let r be a relation instance with schema R = (A, B, C, D). We define r_{1}=\Pi _{A,B,C}(R) and r_{2}=\Pi _{A,D}(R). Let s=r_1*r_2 where * denotes natural join. Given that the decomposition of r into r_1 and r_2 is lossy, which one of the following is TRUE?
GateOverflow

Q29.

Let R1(\underline{A},B,(C)) and R2(\underline{D},E) be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in R1 referring to R2 . Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances r1 and r2 . Which one of the following relational algebra expressions would necessarily produce an empty relation?
GateOverflow

Q30.

Let r and s be two relations over the relation schemes R and S respectively, and let A be an attribute in R. Then the relational algebra expression \sigma _{A=a}(r\Join s) is always equal to :
GateOverflow